<template>
	<view class="page">
		<!-- search -->
		<view class=""
			style="display: flex;flex-direction: row;align-items: center;padding: 12px;background-color: #FFFFFF;justify-content: space-between;">
			<view class="" @click="popBack()">
				<text class="iconfont icon-arrow-left" style="font-size: 16px;font-weight: bold;"></text>
				<text style="font-size: 16px;">{{baseInfo.chnName}}</text>
			</view>
			<view style="
				display: flex;align-items: center; background-color: #55aa0030;
				padding: 5px 12px;border-style: solid;border-width: 1px;border-color: #55aa00;max-width: 90px;">
				<text style="text-align: center;font-size: 14px;color: #55aa00;display: block;">合作中</text>
			</view>
		</view>
		<!-- list -->
		<view class="" style="flex: 1;overflow-y: auto;">
			<!-- 基本信息 -->
			<view style="padding: 12px;background-color: #FFFFFF">
				<form-title :title="baseInfo.title"></form-title>
				<form-key-value-row :keystr="key" :valuestr="baseInfo.data[key]" :tagstr="idx==0?'校园大使':undefined"
					v-for="(key,idx) in Object.keys(baseInfo.data)" :key="idx"></form-key-value-row>
			</view>

		</view>





	</view>
</template>

<script>
	import {
		marketRead
	} from "../../api/workbench.js"
	export default {

		data() {
			return {
				marketId: "",
				"baseInfo": {
					"style": "00",
					"title": "基础资料",
					"chnName":"szw",
					"data": {
						"渠道类型": "校园大使",
						"负责人": "张三",
						"电话": "13066666666",
						"跟进进度": "1111",
						"对接老师": "张学友",
						"创建人": "333",
						"创建时间": "2021年9月26日",
					},



				}
			}
		},
		onLoad(option) {
			this.marketId = option.id;
		},
		mounted() {
			this.netMarketRead()
		},
		methods: {
			popBack() {
				uni.navigateBack({

				})
			},
			netMarketRead() {
				let self = this;
				let fi = {
					id: this.marketId
				};
				marketRead(fi).then(res => {
					let {
						data
					} = res;
					console.error(JSON.stringify(res))
					self.baseInfo.chnName=  data.chnName
					self.baseInfo.data = {
						"渠道类型": data.chnType,
						"负责人": data.chnHead,
						"电话": data.phone,
						"跟进进度": "szw",
						"对接老师": data.dockPeople,
						"创建人": data.createBy,
						"创建时间": data.createTime,
					}
				}).catch(e => {})
			},
		}
	}
</script>

<style scoped>
	.page {
		flex: 1;
		display: flex;
		flex-direction: column;
		background-color: #f4f5f7;
	}
</style>
